package com.xt.purchasingsystem.controller.productionManagement;

import com.xt.purchasingsystem.dto.DFileDto;
import com.xt.purchasingsystem.dto.MDesignProcedureDto;
import com.xt.purchasingsystem.service.productionManagementService.ProductProductionProcessDesignService;
import com.xt.purchasingsystem.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 生产管理--产品生产工序设计的接口
 * Author: 老姚
 * Date:  2020/3/16 10:32
 */

@RestController

@RequestMapping(value = "/productProcessDesign")
public class ProductProductionProcessDesignController {
    @Autowired
    private ProductProductionProcessDesignService productProductionProcessDesignService;

    /**
     * 多条件分页查询可制定产品生产工序设计单的产品档案的接口
     *
     * @param dFileDto
     * @return
     */
    @PostMapping("/queryDFileByMaterialCompositionCompleted")
    public Result queryDFileByMaterialCompositionCompleted(@RequestBody DFileDto dFileDto) {
        return productProductionProcessDesignService.queryDFileByMaterialCompositionCompleted(dFileDto);
    }

    /**
     * 提交生产工序设计单的接口
     *
     * @param mDesignProcedureDto
     * @return
     */
    @PostMapping("/addProductionDesignSheet")
    public Result addProductionDesignSheet(@RequestBody MDesignProcedureDto mDesignProcedureDto) {
        return productProductionProcessDesignService.addProductionDesignSheet(mDesignProcedureDto);
    }

    //分页查询所以未审核的产品生产工序单的接口
    @PostMapping("/queryAllunreviewedMDesignProcedureByPaging")
    public Result queryAllunreviewedMDesignProcedureByPaging(@RequestBody MDesignProcedureDto mDesignProcedureDto) {
        return productProductionProcessDesignService.queryAllunreviewedMDesignProcedureByPaging(mDesignProcedureDto);
    }

    //审核产品工序设计单的接口
    @PostMapping("/reviewProductionDesignSheet")
    public Result reviewProductionDesignSheet(@RequestBody MDesignProcedureDto mDesignProcedureDto) {
        return productProductionProcessDesignService.reviewProductionDesignSheet(mDesignProcedureDto);
    }

}
